import { FahunItem } from "./FahunItem";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { EffectManager } from "../../manager/EffectManager";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { ToolTipInfo } from "../../model/ToolTipInfo";
import { Language } from "../../../../extend/language/Language";
import { GameDefConfig } from "../../resource/GameDefConfig";
import { NormalTooltip } from "../common/tooltip/NormalTooltip";
//class FahunRoleItem
    
    export  class FahunRoleItem extends FahunItem
    {
        constructor(arg1: Boolean=true, arg2: number=32, arg3: number=32)
        {
            super(false);
            ObjCreate.createBitmap(ImagesConst.PackItemBg, -3, -3, this);
            return;
        }

        public set isLight(arg1: Boolean)
        {
            if (arg1) 
            {
                if (!this._lightMask) 
                {
                    this._lightMask = EffectManager.getLightMask(45, 45);
                    this._lightMask.x = -3;
                    this._lightMask.y = -3;
                }
                if (!this._lightMask.parent) 
                {
                    this.addChildAt(this._lightMask, 0);
                }
            }
            else 
            {
                DisplayUtil.removeMe(this._lightMask);
            }
            return;
        }

        protected /* override */ getToolTipData(): ToolTipInfo
        {
            var loc1=null;
            var loc2=null;
            if (fahunItemInfo.isEnable) 
            {
                return super.getToolTipData();
            }
            loc1 = [];
            loc2 = Language.getStringByParam(58024, GameDefConfig.instance.getFahunMW(fahunItemInfo.index));
            if (!_toolTipInfo) 
            {
                _toolTipInfo = new ToolTipInfo(NormalTooltip.ToolTipRenderType_Separate, loc1);
            }
            loc1.push(loc2);
            _toolTipInfo.tooltipData = loc1;
            return _toolTipInfo;
        }

        /* internal */ /* var */_lightMask: LightMask;
    }
